package mhe.mgt;

import mhe.mgt.detail.DetailForm;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.ui.ISharedImages;


public class AddMachinePartAction extends Action {


    AddMachinePartAction(String text) {
        super(text);
        // The id is used to refer to the action in a menu or toolbar
        setId(ICommandIds.CMD_ADD_MACHINE_PART);
        // Associate the action with a pre-defined command, to allow key bindings.
        setActionDefinitionId(ICommandIds.CMD_ADD_MACHINE_PART);
        setImageDescriptor(new ImageDescriptor() {
			
			@Override
			public ImageData getImageData() {
				return Application.getImage(ISharedImages.IMG_ELCL_SYNCED).getImageData();
			}
		});
    }

    public void run() {
        DetailForm.instance.addMachinePartForm();
    }
}